// function compose(...fns) {
//     return function (res) {
//         for (let i = fns.length - 1; i >= 0; i--) {
//             res = fns[i](res)
//         }
//         return res
//     }
// }'

const compose = function (...fns) {
    return fns.reduce((a, b) => (...args) => b(a(...args)))
}

export default compose